package com.yonyou.brigade.third_parties.bfjr.controller;

import com.yonyou.brigade.order_center.model.ThirdResult;
import com.yonyou.brigade.third_parties.bfjr.service.IBfjrPublicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("/bfjr")
public class BfjrEmpInfoController {

    @Autowired
    private IBfjrPublicService bfjrPublicService;

    /**
     * 北方假日员工信息查询
     * @param param
     * @return
     */
    @RequestMapping("/queryEmp")
    public ThirdResult queryBfjrEmp(@RequestBody Map param){
        String phone = param.get("phone").toString();
        String tenant = param.get("tenant").toString();
       return bfjrPublicService.queryEmpInfo(phone,tenant);
    }

    /**
     * 北方假日员工信息删除
     * @param param
     * @return
     */
    @RequestMapping(value = "/delEmp",method = RequestMethod.POST)
    public ThirdResult delBfjrEmp(@RequestBody Map param){
        String phone = param.get("phone").toString();
        String tenant = param.get("tenant").toString();
        return bfjrPublicService.delEmpInfo(phone,tenant);
    }

    /**
     * 北方假日员工信息批量添加
     * @param param
     * @return
     */
    @RequestMapping(value = "/batchAdd",method = RequestMethod.POST)
    public ThirdResult empBatchAdd(@RequestBody Map param){
        String tenant = param.get("tenant").toString();
        return bfjrPublicService.empBatchAdd(tenant);
    }

}
